package com.cg.cn.p1_Demo;

import java.util.Random;
import java.util.Scanner;

public class Demo05GuessNumber {
    public static void main(String[] args) {
        Random r = new Random();
        int guessNum = r.nextInt(100) + 1;
        Scanner sc = new Scanner(System.in);
        int count = 0;
        while (true) {
            System.out.println("请输入您猜测的数字(1到100之间的): ");
            int inputNum = sc.nextInt();
            if (inputNum > guessNum) {
                count++;
                System.out.println("你猜的数据大了");
            } else if (inputNum < guessNum) {
                count++;
                System.out.println("你猜的数据小了");
            } else {
                count++;
                System.out.println("恭喜你猜中了");
                break;
            }
        }
        if (count ==1){
            System.out.println("蒙的");
        } else if (count >=2 && count<5) {
            System.out.println("高智商");
        } else if (count >=6 && count<10) {
            System.out.println("智商一般般");
        } else if (count >=11 && count<20) {
            System.out.println("智商可能有点点问题");
        } else{
            System.out.println("哥们,脑子被/进....");
        }

        System.out.println("一共猜了"+count+"次");
    }
}
